package com.eco
{
	import com.eco.*;
	import com.framework.*;
	
	import flash.display.MovieClip;
	import flash.events.*;
	import flash.utils.*;
	
	//敌人类-原油(黑)
	public class EnemyDarkCrudeOil extends Enemy
	{
		public function EnemyDarkCrudeOil()
		{
			super( 50, 15, Enemy.ENEMY_DARKCRUDEOIL);
			
			iFreezedFrames = 42;
			iAttackPower = 1;
			iAttackPossibility = 200;
		}
		
		override public function Update():void
		{
			super.Update();
		}
		
		override protected function Attack():void
		{
			super.Attack();
		}
		
		override protected function StartSkill():void
		{
			ftFighter.v2dSpeed.x = ftFighter.x - this.x;
			ftFighter.v2dSpeed.y = ftFighter.y - this.y;
			ftFighter.v2dSpeed.setLength( 2*this.iMass/ftFighter.iMass);
			ftFighter.x += (ftFighter.x - this.x);
			ftFighter.y += (ftFighter.y - this.y);	
		}
		
		override protected function EndSkill():void
		{
			;
		}
		
		override protected function BeatFighter():void
		{
			//super.BeatFighter();
			
			//污染的原油敌人受到撞击时，有一定几率获得不稳定效果，在一定时间爆炸，将卫士以污染的原油为中心向外弹开
			if( Math.random()<= iAttackPossibility/800 )
			{
				this.SetState( Enemy.STATE_SKILL );
			}
			
		}
		
		override protected function BeBeaten():void
		{
			super.BeBeaten();
			
			//污染的原油敌人受到撞击时，有一定几率获得不稳定效果，在一定时间爆炸，将卫士以污染的原油为中心向外弹开
			if( Math.random()<= iAttackPossibility/800 )
			{
				this.SetState( Enemy.STATE_SKILL );
			}
		}
		
	}
}